package com.zzptc.lxy.mybook.Adapter;

import android.content.Context;
import android.content.DialogInterface;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;

import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.zzptc.lxy.mybook.Bean.Note;
import com.zzptc.lxy.mybook.NoteActivity;
import com.zzptc.lxy.mybook.R;

import java.text.SimpleDateFormat;
import java.util.List;

public class NoteAdapter extends ArrayAdapter<Note> {
    int resourceid;//声明一个resourceid

    public NoteAdapter(@NonNull Context context, int resource, @NonNull List<Note> objects) {
        super(context, resource, objects);
        this.resourceid = resourceid;
//在接住一个resourceid；
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View view = convertView;
        if (view == null) {
            view = LayoutInflater.from(getContext()).inflate(resourceid, null);

        }
//        实例化
        TextView bookname = view.findViewById(R.id.bookname);
        final TextView notetxt = view.findViewById(R.id.notetxt);
        TextView timetxt = view.findViewById(R.id.timetxt);
        ImageView bookimg = view.findViewById(R.id.bookimg);




        return view;
    }


}
